#ifndef __WxObjectOrientationMarkerInteractor_h
#define __WxObjectOrientationMarkerInteractor_h
#include <mitkStateMachine.h>
#include <itkLandmarkBasedTransformInitializer.h>
#include <mitkImage.h>
#include <itkImage.h>
#include <mitkDataNode.h>
#include <mitkWeakPointer.h>
#include <vtkRenderer.h>
#include "WxExtentionExports.h"
#include "WxObjectOrientationMarker.h"

namespace mitk{
class DisplayGeometry;
class WxExtention_EXPORT WxObjectOrientationMarkerInteractor:public StateMachine
{
public:
        enum SelectedAxis { AXIS_NONE, AXIS_X, AXIS_Y, AXIS_Z};
        mitkClassMacro(WxObjectOrientationMarkerInteractor, StateMachine);
        mitkNewMacro2Param(Self,const char*,DataNode* );

        itkGetMacro( ObjectOrientationMarker, WxObjectOrientationMarker* );

        itkGetMacro( ObjectOrientationMarkerNode, DataNode* );
        itkSetObjectMacro( ObjectOrientationMarkerNode, DataNode );

        void RotateWXYZ(mitk::Vector3D axisOfRotation,double angle);

        inline void MoveOrigin(mitk::Point3D p3d);
        inline bool IsMouseOnOrigin(const mitk::Point3D origin, vtkRenderer* renderer,const mitk::Point2D cursor2d,float error=8);
        inline SelectedAxis IsMouseOnAxis( vtkRenderer* renderer,const mitk::Point2D cursor2d,float error=4);
        static bool IsOn2DLine(mitk::Point2D begin,mitk::Point2D end,mitk::Point2D cursor2d,float error=4);



protected:

	virtual bool ExecuteAction( Action* action, mitk::StateEvent const* stateEvent );	
        WxObjectOrientationMarkerInteractor(const char * type,DataNode* objectOrientationMarkerNode);
        ~WxObjectOrientationMarkerInteractor(void);
        mitk::WeakPointer<mitk::DataNode>  m_ObjectOrientationMarkerNode;
        WxObjectOrientationMarker* m_ObjectOrientationMarker;
        SelectedAxis m_SelectedAxis;
        Point3D m_OriginOld;
        Point2D m_CursorOld2D;
        PlaneGeometry::Pointer m_ViewPlaneGeometry;
        Vector2D m_CursorOriginOnViewPlane;

};
}
#endif //__WxObjectOrientationMarkerInteractor_
